package top.zackyoung.orm.fluent.entity;

import cn.org.atool.fluent.mybatis.annotation.FluentMybatis;
import cn.org.atool.fluent.mybatis.annotation.LogicDelete;
import cn.org.atool.fluent.mybatis.annotation.TableField;
import cn.org.atool.fluent.mybatis.annotation.TableId;
import cn.org.atool.fluent.mybatis.base.IEntity;
import cn.org.atool.fluent.mybatis.base.RichEntity;
import cn.org.atool.fluent.mybatis.processor.entity.FluentEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author ZackYoung
 * @version 1.0
 * @date 2021/11/6
 */
@FluentMybatis(table = "student_score")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class StudentScore implements IEntity {
    @TableId
    private Long id;
    /**
     * 学号
     */
    private Long studentId;
    /**
     * 性别, 0:女; 1:男
     */
    private Boolean genderMan;
    /**
     * 学期
     */
    private Integer schoolTerm;
    /**
     * 学科
     */
    private String  subject;
    /**
     * 成绩
     */
    private Integer score;
    /**
     * 记录创建时间
     */
    @TableField(insert = "now()")
    private Date gmtCreate;
    /**
     * 记录最后修改时间
     */
    @TableField(insert = "now()",update = "now()")
    private Date gmtModified;
    /**
     * 逻辑删除
     */
    @TableField(insert = "0")
    @LogicDelete
    private Boolean isDeleted;

    @Override
    public String toString() {
        return "StudentScore{" +
                "id=" + id +
                ", studentId=" + studentId +
                ", genderMan=" + genderMan +
                ", schoolTerm=" + schoolTerm +
                ", subject='" + subject + '\'' +
                ", score=" + score +
                ", gmtCreate=" + gmtCreate +
                ", gmtModified=" + gmtModified +
                ", isDeleted=" + isDeleted +
                '}';
    }
}
